import thirdPartyPlatformPlayConfigOption from "@/option/tpp/thirdPartyPlatformPlayConfigOption";
import thirdPartyPlatformPlayConfigApi from "@/api/tpp/thirdPartyPlatformPlayConfigApi";
import optionUtils from "@/option/optionUtils";

export default () => {
    return {
        submitText: '修改',
        size: 'default',
        labelWidth: 120,
        index: true,
        
        menuAlign: 'center',
        menuPosition: "right",
        searchIndex: 2,
        searchMenuSpan:6,
        searchIcon: true,
        permissionBtn: {
            addBtn: 'tpp:playOrder:add',
            editBtn: 'tpp:playOrder:edit',
            viewBtn: 'tpp:playOrder:info',
            delBtn: 'tpp:playOrder:delete',
        },
        column: [{
            "addDisplay": false,
            "editDisplay": false,
            "label": "id",
            "prop": "id",
            "hide": true,
            "type": "input"
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "支付状态",
            "prop": "playState",
            "showColumn": true,
            "type": "select",
            dicData: [
                {label: "待支付", value: 0},
                {label: "支付中", value: 1},
                {label: "支付成功", value: 2},
                {label: "支付失败", value: 3},
                {label: "支付异常", value: 99},
                {label: "订单撤销", value: -1},
                {label: "退款中", value: -2},
                {label: "退款成功", value: -3},
                {label: "退款失败", value: -4},
                {label: "退款异常", value: -99},
            ]
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "平台名称",
            "prop": "appId",
            "showColumn": true,
            "type": "table",
            props: {
                label: 'userName',
                value: 'id'
            },
            children: thirdPartyPlatformPlayConfigOption(),
            onLoad: (onLoadParams, callback) => {
                onLoadParams.pageDefinition = thirdPartyPlatformPlayConfigApi.list
                onLoadParams.valueDefinition = thirdPartyPlatformPlayConfigApi.getById
                onLoadParams.option = thirdPartyPlatformPlayConfigOption;
                optionUtils.tableOnLoad(onLoadParams, callback)
            },
            formatter: (row) => {
                if (!row) return;
                if (row.name) {
                    return row.name;
                }
                return row.id;
            }
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "用户类型",
            "prop": "userType",
            "showColumn": true,
            "type": "input"
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "用户id",
            "prop": "userId",
            "showColumn": true,
            "type": "input"
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "数量",
            "prop": "quantity",
            "showColumn": true,
            "type": "number"
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "单价",
            "prop": "price",
            "showColumn": true,
            "type": "number"
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "金额（分）",
            "prop": "totalFee",
            "showColumn": true,
            "type": "number"
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "描述信息",
            "prop": "notes",
            "showColumn": true,
            "type": "input"
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "商品id",
            "prop": "goodsId",
            "showColumn": true,
            "type": "input"
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "业务名称",
            "prop": "goodsName",
            "showColumn": true,
            "type": "input"
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "业务类型",
            "prop": "businessType",
            "showColumn": true,
            "type": "input"
        }, {
            "addDisplay": true,
            "editDisplay": true,
            "label": "业务备注",
            "prop": "businessRemarks",
            "showColumn": true,
            "type": "input"
        }, {
            "addDisplay": false,
            "editDisplay": false,
            "label": "创建人",
            "prop": "createBy",
            "hide": true,
            "type": "input"
        }, {
            "addDisplay": false,
            "editDisplay": false,
            "label": "创建时间",
            "prop": "createTime",
            "hide": true,
            "type": "datetime"
        }, {
            "addDisplay": false,
            "editDisplay": false,
            "label": "修改人",
            "prop": "updateBy",
            "hide": true,
            "type": "input"
        }, {
            "addDisplay": false,
            "editDisplay": false,
            "label": "修改时间",
            "prop": "updateTime",
            "hide": true,
            "type": "datetime"
        }]

    }
}
